package com.roamer.javase.demo.ref;

/**
 * @author roamer
 * @version v1.0
 * @date 2021/3/6 16:44
 */
public class MemoryBean {

    private byte[] alloc;
    private String name;

    public MemoryBean(int size, String name) {
        this.alloc = new byte[size];
        this.name = name;
    }

    @Override
    protected void finalize() throws Throwable {
        super.finalize();
        System.out.println("被GC了[" + this.name + "]");
    }
}
